var phoneOK=true;
var emailOK=true;

function verifyinfo(){
	isphone(phone.value);
	checkEmail(email.value);
	alert (phoneOK && emailOK);
	return (phoneOK && emailOK);
}

function isphone(s){
	phoneOK=true;
	var input=s.trim();
	var patrn=/^[+]?[0-9\-]{7,}$/; 
	if(input.length==0){ $("#phonediv").hide();}
	else if (!patrn.exec(input)){phonediv.innerHTML="电话号码不符合规范";$("#phonediv").show();phoneOK=false;}
	else {
		$("#phonediv").hide();
	}
}

function checkEmail(s){
	emailOK=true;
	var input=s.trim();
	var patrn=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 
	if(input.length==0){ $("#emaildiv").hide();}
	else if (!patrn.exec(input)){emaildiv.innerHTML="邮箱地址不符合规范";$("#emaildiv").show();emailOK=false;}
	else {
		$("#emaildiv").hide();
	}

}